package com.air.acwing;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author shent
 */
public class T802 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = reader.readLine();
        String[] strings = line.split(" ");
        int n = Integer.parseInt(strings[0]);
        int m = Integer.parseInt(strings[1]);
        int[] x = new int[n];
        int[] c = new int[n];
        int[] l = new int[m];
        int[] r = new int[m];

        for (int i = 0; i < n; i++) {
            BufferedReader reader1 = new BufferedReader(new InputStreamReader(System.in));
            String line1 = reader1.readLine();
            String[] strings1 = line1.split(" ");
            x[i] = Integer.parseInt(strings1[0]);
            c[i] = Integer.parseInt(strings1[1]);
        }
        for (int i = 0; i < m; i++) {
            BufferedReader reader2 = new BufferedReader(new InputStreamReader(System.in));
            String line2 = reader2.readLine();
            String[] strings2 = line2.split(" ");
            l[i] = Integer.parseInt(strings2[0]);
            r[i] = Integer.parseInt(strings2[1]);
        }
    }
}
